import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

//https://stackoverflow.com/questions/62371976/align-text-baseline-with-text-inside-a-column-using-flutter
class BaselineDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(title: const Text('AspectRatio Sample')),
          body: const Row(
            // 子元素基于baseline对其排列
            crossAxisAlignment: CrossAxisAlignment.baseline,
            textBaseline: TextBaseline.alphabetic,
            children: [
              Column(
                mainAxisSize: MainAxisSize.min,
                verticalDirection:
                    VerticalDirection.up, // <-- reverse direction
                children: [
                  Text('17:59',
                      style: TextStyle(fontSize: 32)), // <-- first child
                  Icon(Icons.timer),
                ],
              ),
              Text(
                'mm:ss',
                style: TextStyle(fontSize: 12),
              ),
            ],
          )),
    );
  }
}
